import axios from '@/libs/api.request'
import platform from '@/config/platform'
/**
 * 
 * @param { 成员管理 } 
 * @returns 
 */
// 获取职务列表
export const getPostList = params => {
        return axios.request({
            url: platform.BOOKING + '/post/list',
            method: 'get',
            params
        })
    }
    // 添加成员
export const addMember = data => {
        return axios.request({
            url: platform.BOOKING + '/member/management',
            method: 'post',
            data
        })
    }
    // 编辑成员
export const editMember = data => {
        return axios.request({
            url: platform.BOOKING + '/member/management',
            method: 'put',
            data
        })
    }
    // 查看成员
export const lookMemberDetails = id => {
        return axios.request({
            url: platform.BOOKING + `/member/management/${id}`,
            method: 'get',
        })
    }
    // 查看成员
export const delMember = data => {
    return axios.request({
        url: platform.BOOKING + `/member/management/delete`,
        method: 'delete',
        data
    })
}

/**
 * @param { 组织管理 }
 */
// 添加组织
export const addOrganize = data => {
        return axios.request({
            url: platform.BOOKING + '/org',
            method: 'post',
            data
        })
    }
    // 编辑组织
export const editOrganize = data => {
        return axios.request({
            url: platform.BOOKING + '/org',
            method: 'put',
            data
        })
    }
    // 回显组织
export const lookOrganize = id => {
        return axios.request({
            url: platform.BOOKING + `/org/${id}`,
            method: 'get',
        })
    }
    // 删除
export const deleteOrganize = id => {
    return axios.request({
        url: platform.BOOKING + `/org/${id}`,
        method: 'delete',
    })
}